/**
 * 
 */
package marpg.core;

import java.util.List;
import java.util.Map;

/**
 * @author Steven
 * 
 */
public class SimpleAgent extends Agent {
	@Override
	public void setup() {
		setAgentName("Agent_1");
	}

	@Override
	public void recvDoLoginResponse(boolean isAccepted) {
		if (isAccepted) {
			System.out.println("Agent login success.");
			queryGoal();
		} else {
			System.out.println("Agent login failed!");
		}
	}

	@Override
	public void recvDoMoveResponse(boolean isAccepted, Location location) {
		if (isAccepted) {
			System.out.println("Agent move to location accepted. (" + location.toString() + ")");
		} else {
			System.out.println("Agent move to location denied! (" + location.toString() + ")");
		}
	}

	@Override
	public void recvAgentListInformation(List<String> agentList) {
		setAgentList(agentList);
		System.out.println("Agent list: " + agentList.toString());
	}

	@Override
	public void recvGoalInformation(Location location) {
		setGoalLocation(location);
		doMove(getGoalLocation());

		System.out.println("Goal location: " + location.toString());
	}

	@Override
	public void recvItemLocationInformation(List<Location> locations) {
		// TODO Auto-generated method stub

	}

	@Override
	public void recvQueryBackpack(long messageId, String fromAgent) {
		// TODO Auto-generated method stub

	}

	@Override
	public void recvQueryBackpackResponse(long responseId, String fromAgent, boolean accepted) {
		// TODO Auto-generated method stub

	}

	@Override
	public void recvBackpackInformation(String fromAgent, Map<Item, Integer> itemQuantity) {
		// TODO Auto-generated method stub

	}

	@Override
	public void recvQueryStatus(long messageId, String fromAgent) {
		// TODO Auto-generated method stub

	}

	@Override
	public void recvQueryStatusResponse(long responseId, String fromAgent, boolean accepted) {
		// TODO Auto-generated method stub

	}

	@Override
	public void recvStatusInformation(String fromAgent, Map<Status, Integer> statusValue) {
		// TODO Auto-generated method stub

	}

	@Override
	public void recvQueryAgentLocation(long messageId, String fromAgent) {
		// TODO Auto-generated method stub

	}

	@Override
	public void recvQueryAgentLocationResponse(long responseId, String fromAgent, boolean accepted) {
		// TODO Auto-generated method stub

	}

	@Override
	public void recvAgentLocationInformation(String fromAgent, Location location) {
		if (fromAgent.equals(SERVER_NAME)) {
			setCurrentLocation(location);
			System.out.println("Current agent location: " + location.toString());
		}

	}

	@Override
	public void recvRequestMove(long messageId, String fromAgent, Location location) {
		// TODO Auto-generated method stub

	}

	@Override
	public void recvRequestMoveResponse(long responseId, String fromAgent, boolean accepted) {
		// TODO Auto-generated method stub

	}

	@Override
	public void recvRequestGiveItem(long messageId, String fromAgent, Map<Item, Integer> itemQuantity) {
		// TODO Auto-generated method stub

	}

	@Override
	public void recvRequestGiveItemResponse(long responseId, String fromAgent, boolean accepted,
			Map<Item, Integer> proposedItemQuantity) {
		// TODO Auto-generated method stub

	}

	@Override
	public void recvDoGiveItem(long messageId, Map<Item, Integer> itemQuantity) {
		// TODO Auto-generated method stub

	}

	@Override
	public void recvRequestGetItem(long messageId, String fromAgent, Map<Item, Integer> itemQuantity) {
		// TODO Auto-generated method stub

	}

	@Override
	public void recvRequestGetItemResponse(long responseId, String fromAgent, boolean accepted,
			Map<Item, Integer> proposedItemQuantity) {
		// TODO Auto-generated method stub

	}

	@Override
	public void recvDoGetItem(long messageId, Map<Item, Integer> itemQuantity) {
		// TODO Auto-generated method stub

	}
}